import http from '@/http';

const url = '/api/userSystem/common';

// 获取图片验证码
export async function getCaptcha(options = {}) {
  return await http.request('get', `${ url }/captcha`, options).then(res => {
    if (!options.waitingMask) {
      http.tip(res);
    }
    return res;
  });
}
// 用户登录
export async function doLogin(options = {}) {
  return await http.request('post', '/api/userSystem/login', options).then(res => {
    if (res.code == 200) {
      res.message = '登录成功！';
    }
    if (!options.waitingMask) {
      http.tip(res, {
        showClose: true
      });
    }
    return res;
  });
}
// 获取枚举数组
export async function getEnums(id, options = {}) {
  return await http.request('get', `/api/userSystem/enums/${ id }`, options).then(res => {
    if (!options.waitingMask) {
      http.tip(res);
    }
    return res;
  });
}

